﻿using Newtonsoft.Json;

namespace AutomationCommand
{
    public class ppt_make : BasiCommand
    {
        [JsonProperty("fun_type")]
        public string FunType { get; set; }

        [JsonProperty("othername")]
        public string OtherName { get; set; }

        [JsonProperty("path")]
        public string Path { get; set; }

        [JsonProperty("o")]
        public string Operation { get; set; }

        [JsonProperty("slide")]
        public string Slide { get; set; }

        [JsonProperty("make")]
        public string Make { get; set; }

        [JsonProperty("date")]
        public string Date { get; set; }

        [JsonProperty("style")]
        public Style Style { get; set; }

        public ppt_make()
        {
            FunType = "ppt_make";
            OtherName = "ppt制作";
            Path = "";
            Operation = "open";
            Slide = "1";
            Make = "text";
            Date = "keyname";
            Style = new Style
            {
                Color = new Color
                {
                    Bc = "000000",
                    Fc = "ffffff"
                },
                Point = new Point
                {
                    X = "0",
                    Y = "0"
                },
                Size = new Size
                {
                    W = "10",
                    H = "10"
                },
                Line = "0",
                Type = "xl3DArea"
            };
            SuccessJump = -1;
            FailureJump = -1;
        }

        public bool Execute()
        {
            // 在这里编写执行PPT制作命令的逻辑
            // 返回执行结果
            return true; // 假设此处始终成功
        }
    }

    public class Style
    {
        [JsonProperty("color")]
        public Color Color { get; set; }

        [JsonProperty("point")]
        public Point Point { get; set; }

        [JsonProperty("size")]
        public Size Size { get; set; }

        [JsonProperty("line")]
        public string Line { get; set; }

        [JsonProperty("type")]
        public string Type { get; set; }
    }

    public class Color
    {
        [JsonProperty("bc")]
        public string Bc { get; set; }

        [JsonProperty("fc")]
        public string Fc { get; set; }
    }

    public class Point
    {
        [JsonProperty("x")]
        public string X { get; set; }

        [JsonProperty("y")]
        public string Y { get; set; }
    }

    public class Size
    {
        [JsonProperty("w")]
        public string W { get; set; }

        [JsonProperty("h")]
        public string H { get; set; }
    }
}
